import request from '@/router/axios'

/**
 * 分页查询流程
 *
 * @param query
 */
export function pageProcess (query) {
    return request({
        url: '/act/monitor/process',
        method: 'get',
        params: query
    })
}

/**
 * 完成任务
 *
 * @param taskId
 * @param params
 */
export function taskComplete (taskId,params) {
    return request({
        url: '/act/monitor/task/' + taskId + '/complete',
        method: 'put',
        data: params
    })
}

/**
 * 获取流程处理历史
 *
 * @param params
 */
export function pageTaskHis(params) {
    return request({
        url: '/act/monitor/task/his',
        method: 'get',
        params: params
    })
}

/**
 * 获取任务信息
 *
 * @param params
 */
export function getTaskInfo(taskId) {
    return request({
        url: '/act/monitor/task/' + taskId,
        method: 'get'
    })
}

/**
 * 获取流程变量
 *
 * @param params
 */
export function listProcessVariables(params) {
    return request({
        url: '/act/monitor/process/variables',
        method: 'get',
        params: params
    })
}

/**
 * 添加流程
 *
 * @param params
 */
export function addProcess(params) {
    return request({
        url: '/act/monitor/process',
        method: 'post',
        data: params
    })
}